package org.hegang.design.first.prototypepattern;

/**
 * @ClassName AbstractShape
 * @Describe: 原型模式
 * @Author: gang.he
 * @Email: SmileSkylife@outlook.com
 * @Date: Created in 23:03 2019/7/3
 * @Modified_By: TODO
 * @Version: V1.0
 */
public abstract class AbstractShape implements Cloneable{
    private String id;
    protected String type;
    abstract void draw();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public Object clone(){
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}
